package com.book.utils;

import org.apache.commons.beanutils.BeanUtils;
import java.util.Map;

public class webUtils {
    public static void fillBean(Object obj, Map map){
        try {
            BeanUtils.populate(obj, map);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 将字符串转换为int类型
     * @param str
     * @return
     */
    public static int parseInt(String str,Integer defaultVal){
        try {
            return Integer.parseInt(str);
        } catch (Exception e) {
//            e.printStackTrace();
        }
        return defaultVal;
    }
}
